if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetMenuByRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetMenuByRole]
GO
CREATE PROC sp_GetMenuByRole
	@role  varchar(30)
AS
BEGIN
	SELECT A.ID, A.Role, B.MenuName, B.URL
		FROM UserMenu As A INNER JOIN Menu As B ON A.MenuID = B.ID
		WHERE A.Role = @role
END